<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="wangyuguo">
		<TITLE>操作员授权审核</TITLE>
		<script language="javascript" type="text/javascript" src="../script/common.js"></script>
		<script language="javascript" type="text/javascript" src="../script/tree.js"></script>
		<script language="javascript" type="text/javascript">
			//全局变量
			var qt = {};
			//数据表格对象
			var groupId = null;
			
			function load() {
				Eui.showNavigation();
				setPages(["roleview","listview","detview"]);
				
				searchForm.organization.value = Common.cOrg().id;
				Common.initDict(searchForm.gender, "gender", "全 部");  			//初始化性别(查询form)
				createTable();
			}
			
			/**查询部分**/
			function createTable() {
				var columns = [];
				columns[0] = {render:nameFunc}
				columns[4] = {render:roleFunc}
				columns[5] = {title:"操作",order:false,render:authFunc}
				qt = new QueryTable("audit_acl", "searchForm", "datalist", columns);
			}
			
			//数据处理方法
			function nameFunc(v, r) {//处理数据 点姓名进入编辑页面
				return "<a href=# onclick=\"showOperator(" + r[7] + ");return false;\">" + v + "</a>";
			}
			
			function roleFunc(v, r) {
				return "<a href=# onclick=\"showRole(" + r[5] + ")\">" + v + "</a>";
			}
			
			function authFunc(v, r) {
				return "<a href=# onclick=\"approveOperator(" + r[6] + ",'"+r[0]+"','"+r[4]+"');return false;\">通过</a> " + " <a href=# onclick=\"refuseOperator(" + r[6] + ",'"+r[0]+"','"+r[4]+"');return false;\">拒绝</a>"
			}
			
			/**明细部分**/
			//显示操作员明细
			function showOperator(id) {
				switchPage("detview");
				SystemMgnt.showOperator("opergroupview",id);
			}
			//显示角色明细
			function showRole(id) {
				switchPage("detview");
				SystemMgnt.showGroup("opergroupview",id);
			}
			
			/**其他页面功能**/
			
			//批准审核
			function approveOperator(id,member,group) {
				if (showQuestion("是否批准给『"+member+"』赋予『"+group+"』的权力？")){
					DWR.call("auditService.approveRequest", id, function() {
						showInformation("操作员授权审核已批准");
						qt.showTable();
					},{blockScreen:true})
				}
			}
			//拒绝审核
			function refuseOperator(id,member,group) {
				if (showQuestion("是否拒绝给『"+member+"』赋予『"+group+"』的权力？")){
					DWR.call("auditService.refuseRequest", id, function() {
						showInformation("操作员授权审核已拒绝");
						qt.showTable();
					},{blockScreen:true})
				}
			}
		</script>
	</head>
	
	<body onload="load()">
		<!--页面导航-->
		<div class="nav"><div id="nav">&nbsp;</div></div>
	
		<!--查询静态页面部分-->
		<div id="listview">
			<!--查询条件form-->
			<div class="searchForm">
				<form id="searchForm" name="searchForm">
					<input type="hidden" name="organization">
					<table cellSpacing="0" cellPadding="4" width="100%" border="0" class="col5 label5">
						<tr>
							<td>
								<label>姓&nbsp;&nbsp;&nbsp;&nbsp;名</label>
								<input type="text" name="name" maxlength="20">
							</td>
							<td>
								<label>操作员编码</label>
								<input type="text" id="uniqueId" name="uniqueId" maxlength="20" onblur="checkV(this,'number')">
							</td>
							<td>
								<label>登陆帐号</label>
								<input type="text" name="loginName" maxlength="20">
							</td>
						</tr>
						<tr>
							<td>
								<label>性&nbsp;&nbsp;&nbsp;&nbsp;别</label>
								<select name="gender"><option></option></select>
							</td>
							<td>&nbsp;</td>
							<td><button type="button" onclick="qt.showTable()">查 询</button></td>
						</tr>
					</table>
				</form>
			</div>
			<div id="datalist"></div>
		</div>
		<div id="detview" style="display:none;">
			<div id="opergroupview"></div>
			<p>
				<button type="button" onclick="switchPage('listview');">返 回</button>
			</p>
		</div>
	</body>
</html>
